( function(){
	window.assert = function( condition, msg ){
		var entry = createLogEntry();
		if( condition ){
			entry.setAttribute( 'class', 'passed' );
		}
		else{
			entry.setAttribute( 'class', 'failed' );
		}
		entry.innerHTML = msg;
	}
	function createLogEntry(){
		var log = document.getElementById( '__assertLog' );
		if( ! log || log.length < 1 ){
			log = document.createElement( 'ul' );
			log.setAttribute( 'id', '__assertLog' );
			log.setAttribute( 'class', 'assert' );
			document.body.appendChild( log );
		}
		var li = document.createElement( 'li' );
		log.appendChild( li );
		return li;
	}
})();
